package cn.bandeqing.orderCost.entity;

import cn.bandeqing.finance.req.FinanceCostSaveOrUpdateReq;
import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.sql.Timestamp;

/**
 * 订单成本 实体类。
 *
 * @author fugui
 * @since 2024-01-23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "bdq_order_cost", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMapper(target = FinanceCostSaveOrUpdateReq.class, convertGenerate = false)
public class OrderCost extends BaseEntity {

    /**
     * ID
     */
    @Id(keyType = KeyType.Auto)
    private Long ocId;

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 小哥ID
     */
    private Long workerId;
    private String workerNickName;

    /**
     * 用户ID
     */
    private Long usId;
    private String usNickName;

    /**
     * 成本金额
     */
    private Double ocMoney;

    /**
     * 成本类型 0=工时费 1=分成
     */
    private OcType ocType;

    /**
     * 用户分成类型
     */
    private UsSplitType usSplitType;

    /**
     * 用户分成比例
     */
    private Double usSplitProportion;

    /**
     * 结算时间
     */
    private Timestamp ocSettlementTime;

    /**
     * 结算用户ID
     */
    private Long ocSettlementUserId;

    /**
     * 结算用户
     */
    private String ocSettlementUserName;

    /**
     * 成本描述
     */
    private String ocDesc;

}
